home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / mcu11 / evb_an.arc / HC11EVB.AN1
Text File  |  1989-04-18  |  12KB  |  316 lines

  1.   EVALUATION BOARD APPLICATION NOTE                                                                                                                                      MOTOROLA
  2.    1                                                                                                                                                                                                              M68HC11EVB/AN1
  3.  
  4.   EVALUATION BOARD APPLICATION NOTE                                                                                                                                        MOTOROLA
  5.    M68HC11EVB/AN1                                                                                                                                                                                                                1
  6.  
  7.  
  8.                                                M68HC11EVB/AN1
  9.  
  10.                                                  September 1988
  11.  
  12.  
  13.  
  14. EVB APPLICATION NOTE
  15.  
  16.  
  17. (Special Test Mode Operation)
  18.  
  19.  
  20.  
  21. INTRODUCTION
  22.  
  23. This application note provides information on how to operate the M68HC11EVB Evaluation Board (EVB) in the special test mode.  The EVB is designed to operate the resident MC68HC11xx MCU in the expanded multiplexed mode of operation.  A variation of the expanded multiplexed mode is the special test mode, which allows the user special privileges (i.e., no time-out on protected registers, CONFIG register programming, etc.).  The special test mode can be used if, for some reason, the configuration (CONFIG) register gets corrupted and the user needs to change the register contents.
  24.  
  25.  
  26. ENTERING THE SPECIAL TEST MODE
  27.  
  28. Entering the special test mode is accomplished by grounding the EVB resident  MC68HC11xx MCU MODB pin (jumper connector P1 pins 1 and 2) and initiate a reset condition by pressing the RESET switch S1.  The special test reset vector resides at locations $BFFE and $BFFF versus $FFFE and $FFFF for normal modes of operation.  The RAM/EPROM socket (U4) is remapped by removing the jumper on jumper header J3 and reinstalling the jumper on jumper header J7.  Socket U4 is now remapped from $A000 through $BFFF for user application program.
  29.  
  30.  
  31. CONFIGURATION REGISTER
  32.  
  33. The configuration (CONFIG) register is an EEPROM byte located initially at $103F in the MC68HC11xx MCU memory map.  Upon a reset condition the CPU loads the CONFIG register contents into a set of MCU latches.  These latches contain the data which is displayed on the terminal when performing a memory display (MD) operation of the CONFIG register ($103F).
  34.  
  35.  
  36. Special test mode operations are described as follows:
  37.  
  38.     a.    Enabling COP Watchdog System via CONFIG Register NOCOP Bit
  39.     b.    MC68HC811A2 Resident MCU Operation
  40.     c.    Programming an MC68HC811A2 for Single-Chip Applications
  41.     d.    Clearing CONFIG Register ROMON Bit
  42.  
  43.  
  44.  
  45. Enabling COP Watchdog System via CONFIG Register NOCOP Bit
  46.  
  47.  
  48.  
  49.  
  50. Suppose the user is finished with initial debugging and wants to enable the computer operating properly (COP) watchdog system by programming the NOCOP bit in the CONFIG register to a logic zero.  For MC68HC11xx mask sets B96D and higher, this operation can only be accomplished using either the special test  or bootstrap mode of operation.
  51.  
  52.  
  53. Steps required:
  54.  
  55.  
  56.     a.   Install 6264 RAM (8Kx8) or equivalent device in socket location U4.
  57.  
  58.     b.   Memory modify (MM) locations $BFFE and $BFFF to contain $E00A.
  59.  
  60.         ($E00A enables reset vector to jump to BUFFALO.)
  61.  
  62.     c.   Remove jumper J3 and reinstall on J7.
  63.  
  64.     d.   Jumper connector P1 pins 1 and 2.
  65.  
  66.     e.   Press RESET switch S1.
  67.  
  68.  
  69.  
  70. At this point the user should be in the BUFFALO monitor program and operating in the special test mode.  By entering MD 103F on the terminal keyboard, the user can display the contents of the CONFIG register latches.  For example, if the ROMON bit is a logic zero and the EEON bit is a logic one for an MC68HC11A1 MCU device, the terminal will display $0D.
  71.  
  72.  
  73. To turn on the COP, the user enters MM 103F and changes the memory contents to $09.  BUFFALO treats EEPROM as a RAM location.  The MM command programs the location if found to be EEPROM.  If a memory display (MD) of location $103F was again performed, a $0D would be displayed since the CONFIG register latches are not updated until the next reset operation.
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87. MC68HC811A2 Resident MCU Operation
  88.  
  89.  
  90.  
  91.  
  92. Many users want to operate the MC68HC811A2 device in the EVB as the resident MCU.  Using the MC68HC811A2 device will normally cause EVB problems because the erased CONFIG register places the 2K of EEPROM at locations $F800-FFFF.  Locations $F800-FFFF will be in conflict with the BUFFALO monitor program in EPROM.  However, by operating in the special test mode, the CONFIG register EEON bit is forced to a logic zero.  At this point, the user must move the EEPROM to a location other than $E800-EFFF or $F800-FFFF and then turn the EEPROM back on.
  93.  
  94.  
  95. Steps required:
  96.  
  97.  
  98.     a.    Install 2764 EPROM (8Kx8) or equivalent device in socket location U4 with 
  99.         EPROM locations $1FFE and $1FFF programmed to contain $E00A.
  100.  
  101.             ($E00A enables reset vector to jump to BUFFALO.)
  102.  
  103.     b.    Remove jumper J3 and reinstall on J7.
  104.  
  105.     c.     Jumper connector P1 pins 1 and 2.
  106.  
  107.     d.    Press RESET switch S1.
  108.  
  109.  
  110.  
  111. At this point the user should be in the BUFFALO monitor program and operating in the special test mode.  By entering MD 103F on the terminal keyboard, the user can display the contents of the CONFIG register latches.  For example, if the MCU device was previously erased, the CONFIG register latches would contain $FE (not $FF since in EEON bit is initially forced to a logic zero).  To move the EEPROM to another location, the user enters MM 103F and changes the CONFIG register latch contents to $xF (where x is the high-order byte of the address desired; again x cannot be $E or $F).
  112.  
  113.  
  114. NOTE
  115.  
  116.     When using the MC68HC811A2 device, the user writes directly to the CONFIG register latches; therefore, memory display (MD) of $103F will result in the changed value to be displayed without resetting the MCU.
  117.  
  118.  
  119.  
  120.  
  121. Programming an MC68HC811A2 for Single-Chip Applications
  122.  
  123.  
  124.  
  125.  
  126. If the user requires a target system MC68HC811A2 device to operate in a single chip mode, the user must have 2K of EEPROM turned-on via the CONFIG register EEON bit , and the 2k of EEPROM must be remapped to $F800-FFFF.  To accomplish this on the EVB, the user must first move the 2K EEPROM to another location other than $E800-EFFF or $F800-FFFF and then turn the EEPROM back on.  The user must then inform the BUFFALO monitor program that the EEPROM does not reside at the starting location $B600 via the modify EEPROM range (EEMOD) command.  (The reassigned starting location will also indicate that the device is not an MC68HC11A1 MCU.)
  127.  
  128.  
  129. Another problem exists in that the EVB RAM is located at $C000 through $DFFF, and a user program originated at $F800 through $FFFF cannot be downloaded into the EVB RAM.  This problem is now corrected via the addition of the OFFSET command.  The OFFSET command will either add or subtract a hexadecimal value from the S-record address locations.
  130.  
  131.  
  132. The EEMOD and OFFSET commands were added to the BUFFALO monitor program (Rev 3.4).  Rev 3.4 of the BUFFALO monitor program is available on the Motorola's freeware line, (512)-440-FREE.
  133.  
  134.  
  135. As shown on the following page, the user programs the 2K of EEPROM via the MOVE command, and then reprograms the CONFIG register to place the EEPROM back to locations $F800-FFFF.  The example also assumes that a 2K program was downloaded into socket location U5 (at location $C800).  This can be accomplished by downloading a user program originally originated at $F800 through $FFFF as follows:
  136.  
  137.  
  138.  
  139.     Enter:
  140.  
  141.  
  142.         >OFFSET -3000            Subtract 3000 from S-record address.
  143.  
  144.         D000                    Positive offset  added to S-record address.
  145.         >
  146.  
  147.  
  148.         >LOAD cat filename.S19        Address locations $F800-FFFF become 
  149.                             $C800-CFFF.
  150.         DONE
  151.         >
  152.  
  153.  
  154.  
  155.  
  156.  
  157. Programming an MC68HC811A2 for Single-Chip Applications (cont'd)
  158.  
  159.  
  160.  
  161.  
  162. Steps required:
  163.  
  164.  
  165.     a.    Install 2764 EPROM (8Kx8) or equivalent device in socket location U4 with 
  166.         locations $1FFE and $1FFF programmed to contain $E00A.
  167.  
  168.             ($E00A enables reset vector to jump to BUFFALO.)
  169.  
  170.     b.    Remove jumper J3 and reinstall on J7.
  171.  
  172.     c.    Jumper connector P1 pins 1 and 2.
  173.  
  174.     d.    Press RESET switch S1.
  175.  
  176.     e.    Enter:
  177.  
  178.  
  179.             >MM 103F                Examine location $103F.
  180.  
  181.             103F FE 8F(RETURN)        Move EEPROM to $8800-8FFF.
  182.             >
  183.  
  184.  
  185.             >EEMOD 8800            Inform BUFFALO of EEPROM location.
  186.             >
  187.  
  188.  
  189.             >MOVE C800 CFFF 8800        Program 2K EEPROM (approx. 30 sec.)
  190.             >
  191.  
  192.  
  193.             >MM 103F                Examine location $103F.
  194.  
  195.             103F 8F FF(RETURN)        Move EEPROM back to $F800-FFFF.
  196.             >                    Terminate MM operation.
  197.  
  198.  
  199.  
  200. At this point, power down the EVB, remove the MC68HC811A2 device and reinstall  
  201. in target system.  BUFFALO will not operate at this time.
  202.  
  203.  
  204. Clearing CONFIG Register ROMON Bit
  205.  
  206.  
  207.  
  208.  
  209. If the CONFIG register ROMON bit in the MC68HC11 MCU device is accidently turned on, the EVB will not operate because ROM is residing at locations $E000-FFFF.  BUFFALO also resides at locations $E000-FFFF.  In this example, simply activating the special test mode and vectoring to BUFFALO will not  work.  Therefore the user must not only replace RAM with EPROM, but must also write a small routine that will turn off the CONFIG register ROMON bit.
  210.  
  211.  
  212. Steps required:
  213.  
  214.  
  215.     a.    Program 2764 EPROM (8Kx8) or equivalent device with the program supplied 
  216.         on the following page of this application note.
  217.  
  218.     b.    Install programmed 2764 EPROM (8Kx8) or equivalent device in socket  
  219.         location U4.
  220.  
  221.     c.    Remove jumper J3 and reinstall on J7.
  222.  
  223.     d.    Jumper connector P1 pins 1 and 2.
  224.  
  225.     e.    Press RESET switch S1.
  226.  
  227.     f.     Remove jumper previously installed on connector P1 pins 1 and 2.
  228.  
  229.     g.    Press RESET switch S1.
  230.  
  231.  
  232.  
  233.             BUFFALO monitor program should now be operating.
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243. Clearing CONFIG Register ROMON Bit (cont'd)
  244.  
  245.  
  246. 2764 EPROM PROGRAM
  247.  
  248. ************************************************************************************
  249.  
  250.  
  251.         *Program to turn off CONF register ROMON bit
  252.  
  253.  
  254. 1FFE               ORG   $1FFE
  255. 1FFE A000          FDB   $A000    force reset to jump to $A000 (U4)
  256.  
  257. 0000               ORG   $0
  258. 0000 8E 00 FF      LDS   #$00FF
  259. 0003 8D 24         BSR   DLY10    allow charge pump to stabilize
  260.  
  261.  
  262.         *
  263.         *Erase CONFIG register
  264.         *
  265.  
  266.  
  267. 0005 C6 16         LDAB  #$16        byte erase and EELAT on
  268. 0007 F7 10 3B      STAB  $103B    write to PROG register
  269. 000A B7 10 3F      STAA  $103F    dummy write to CONFIG register
  270. 000D 5C            INCB            to $17 - turn on EEPGM bit
  271. 000E F7 10 3B      STAB  $103B    write to PROG register
  272. 0011 8D 16         BSR   DLY10    delay 10 ms for erase to be complete
  273. 0013 7F 10 3B      CLR   $103B    turn off charge pump (EEPGM to 0)
  274.  
  275.  
  276.         *
  277.         *Reprogram CONFIG register with desired data
  278.         *
  279.  
  280.  
  281. 0016 C6 02         LDAB  #$02        turn on EELAT
  282. 0018 F7 10 3B      STAB  $103B    write to PROG register
  283. 001B 86 0D         LDAA  #$0D        choose NOSEC, NOCOP, ROMON=0, EEON
  284. 001D B7 10 3F      STAA  $103F    write to CONFIG register
  285. 0020 5C            INCB            to $03 - turn on EEPGM bit
  286. 0021 F7 10 3B      STAB  $103B    write to PROG register
  287. 0024 8D 03         BSR   DLY10    delay 10 ms for program to complete
  288. 0026 7F 10 3B      CLR   $103B    turn off charge pump (EEPGM to 0)
  289. 0029 20 FE    SELF BRA   SELF
  290.  
  291.  
  292.         *
  293.         *Programming complete, results not implemented until next reset
  294.         *
  295.  
  296.  
  297. 002B CE 0D06 DLY10 LDX   #$0D06    3334 * 6 cycles * 500nS (2MHz)  =10mS
  298. 002E 09      DLOOP DEX
  299. 002F 26 FD         BNE   DLOOP
  300. 0031 39            RTS
  301.  
  302.  
  303. ************************************************************************************
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.